import { Button, Modal,Space, Table, Tag } from 'antd';
import React, { useEffect, useState } from 'react';

const MyModal = ({ open, close ,allData}) => {
  // console.log(allData)
  const handleOk = () => {
    close()
  };
  const handleCancel = () => {
    close()
  };

  const columns = [
    {
      title: '服务名称',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '价格',
      dataIndex: 'price',
      key: 'price',
    },
    {
      title: '描述',
      dataIndex: 'desc',
      key: 'desc',
    },
    {
      title: '类型',
      dataIndex: 'serviceTypeId',
      key: 'serviceTypeId',
    },
  ];


  const [data,setData]=useState([])
  useEffect(()=>{
    setData(allData)
  })

  return (
    <div>

      <Modal title="用户详细信息" open={open} onOk={handleOk} onCancel={handleCancel}>
      <Table   rowKey="id" columns={columns} dataSource={data} />
      </Modal>
    </div>
  )
}

export default MyModal